#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>


void Swap(int* left,int* right)
{
	while (left < right)
	{
		int tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}


int ch[100];

int main()
{
	int i = 0;
	for (i = 0; i < 101; i++)
	{
		scanf("%d", &ch[i]);
		if (ch[i] == 0)
			break;
	}
	Swap(ch,ch[i-1]);
	int j = 0;
	for (j = i - 1; j >= 0; j--)
	{
		printf("%d ", ch[j]);
	}
	return 0;
}